// $Id:rd.h 67 2007-11-09 17:37:47Z wimleers $


/**
 * Piece class header file.
 *
 * @file Piece.h
 * @author Bram Bonn&eacute;
 */


#ifndef PIECE_H_INCLUDED
#define PIECE_H_INCLUDED

enum Color { EMPTY, BLACK, WHITE };

class Piece {
	public:
		Piece() {m_color = EMPTY;}
		Piece(Color c) {m_color = c;}
		Color Get() const {return m_color;}
		void Set(Color c) {m_color = c;}
		Color GetOther() const;
		void Toggle() {m_color = GetOther();}
		bool operator==(Color other) const {return (m_color == other);}
		bool operator==(const Piece & other) const {return (m_color == other.Get());}
		bool operator!=(Color other) const {return (m_color != other);}
		bool operator!=(const Piece & other) const {return (m_color != other.Get());}
		void operator=(Color other) {m_color = other;}

	private:
		Color m_color;
};

#endif // PIECE_H_INCLUDED
